package com.yiren.backstage.communication.services;

import com.yiren.backstage.currency.enums.CarStateNameEnum;
import com.yiren.backstage.currency.enums.CarStateValueEnum;

/**
 * Time:2021/11/24 8:28
 * Author:xiaozan
 * Description:解析状态服务 接口类
 */
public interface IAnalysisStateService {

    /**
     * 状态值为开启、关闭
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum openAndCloseState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 状态值为松开、拉紧
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum loosenAndCockingState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 状态值为踩住、松开
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum brakeingAndLoosenState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 状态值为系好、松开
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum hitchAndLoosenState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 状态值为调整、未调整
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum adjustAndNoAdjustState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 状态值为通过、未通过
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum passAndNoPassState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 状态值为触摸、未触摸
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum touchAndNoTouchState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 车钥匙
     * @param carStateNameEnum
     * @param carStateSignalValue
     * @param value
     * @return
     */
    CarStateValueEnum carKeyState(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);

    /**
     * 车速处理
     *
     * @param odbValue OBD返回值
     * @param jxValue  JX方式返回值
     * @return
     */
    float jxSpeed(String odbValue, float carStateSignalValue, String jxValue);

    /**
     * 转速处理
     *
     * @param odbValue OBD返回值
     * @param jxValue  JX方式返回值
     * @return
     */
    float jxRotateSpeed(String odbValue, float carStateSignalValue, String jxValue);

    /**
     * 车钥匙状态
     *
     * @param value 数据解析值
     * @return
     */
    CarStateValueEnum carKeyState(byte[] value);

    /**
     * OBD档位
     *
     * @param value 数据解析值
     * @return
     */
    CarStateValueEnum obdGear(int value);

    /**
     * 转向灯信号处理
     *
     * @param carStateNameEnum    车辆状态
     * @param carStateSignalValue 信号系数正反转
     * @param value               数据解析值
     * @return
     */
    CarStateValueEnum corneringLamp(CarStateNameEnum carStateNameEnum, boolean carStateSignalValue, int value);


}
